package com.wzl.mixed.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * 缓存数据上载配置信息
 *
 * @author weizhongli
 * @since 1.0, 2023/05/04 11:19
 */
@Component
@ConfigurationProperties("cache-mgr")
public class JsCacheMgrConfigHolder {
    /**
     * 加载脚本
     */
    private Map<String, List<JsCacheMgrConfig>> mapper;

    /**
     * 每次从数据库中获取的记录数
     */
    private int selectLimit = 10000;

    /**
     * 每次提交到缓存的数据条数
     */
    private int batchInsert = 1000;

    /**
     * 上载超时时间,单位:秒
     */
    private int loadingTimeout = 1800;

    public Map<String, List<JsCacheMgrConfig>> getMapper() {
        return mapper;
    }

    public void setMapper(Map<String, List<JsCacheMgrConfig>> mapper) {
        this.mapper = mapper;
    }

    public int getSelectLimit() {
        return selectLimit;
    }

    public void setSelectLimit(int selectLimit) {
        this.selectLimit = selectLimit;
    }

    public int getBatchInsert() {
        return batchInsert;
    }

    public void setBatchInsert(int batchInsert) {
        this.batchInsert = batchInsert;
    }

    public int getLoadingTimeout() {
        return loadingTimeout;
    }

    public void setLoadingTimeout(int loadingTimeout) {
        this.loadingTimeout = loadingTimeout;
    }

}